﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BE = Skynet.BusinessEntities;
using DC = Skynet.ServiceContracts.DataContracts;
namespace Skynet.ServiceImplementation.Translators
{
    public class ExamCategoryTranslator : Infrastructure.Aspect.Services.Traslator.EntityMapperTranslator<BE.ExamCategory, DC.DCExamCategory>
    {
        protected override DC.DCExamCategory BusinessToService(Infrastructure.Aspect.Services.Traslator.IEntityTranslatorService service, BE.ExamCategory value)
        {
            var result = new DC.DCExamCategory();
            result.Id = value.Id;
            result.Title = value.Title;
            result.Description = value.Description;
            return result;
        }
        protected override BE.ExamCategory ServiceToBusiness(Infrastructure.Aspect.Services.Traslator.IEntityTranslatorService service, DC.DCExamCategory value)
        {
            var result = new BE.ExamCategory();
            result.Id = value.Id;
            result.Title = value.Title;
            result.Description = value.Description;
            return result;
        }
    }
    public class ExamCategoriesTranslator : Infrastructure.Aspect.Services.Traslator.EntityEnumerableMapperTranslator<BE.ExamCategory, DC.DCExamCategory>
    {
        protected override IEnumerable<DC.DCExamCategory> BusinessToService(Infrastructure.Aspect.Services.Traslator.IEntityTranslatorService service, IEnumerable<BE.ExamCategory> value)
        {
            var result = new List<DC.DCExamCategory>();
            foreach (var item in value)
            {
                result.Add(service.Translate<DC.DCExamCategory>(item));
            }
            return result;
        }

        protected override IEnumerable<BE.ExamCategory> ServiceToBusiness(Infrastructure.Aspect.Services.Traslator.IEntityTranslatorService service, IEnumerable<DC.DCExamCategory> value)
        {
            var result = new List<BE.ExamCategory>();
            foreach (var item in value)
            {
                result.Add(service.Translate<BE.ExamCategory>(item));
            }
            return result;
        }
    }
}
